
<include file="layout/header" />
<style>
	.node {display:none}
	.fade-enter-active, .fade-leave-active {
		transition: opacity .5s
	}
	.fade-enter, .fade-leave-active {
		opacity: 0
	}
	.float-right label{
		float: right;
	}
	.float-right label span{
		color: darkred;
		font-size: 16px;
		line-height: 18px;
	}
	.isok{
		background: #3276b1;
		color: white;
		cursor: pointer;
		line-height: 32px;
	}
	.isok2{
		background: white;
		border:1px solid #666;
		cursor: pointer;
		line-height: 32px;
	}
	.isok2:hover{
		background: #eee;
	}
	.span1,.span2{
		position: absolute;		 
		 max-width: 300px;
		 background: white;
		 border:1px solid #ccc;
		 min-height: 60px;
		 padding:5px;
		 line-height: 20px;
		 font-size: 14px;
		 border-radius: 5px;
	}
	.span1{
		left: 70px; 
		 top: 20px;
	}
	.span2{
		min-height: 40px;
		right: 80px;
		bottom: 20px;
	}
</style>

<div id="content">

	<section id="widget-grid" class="">
		<!-- START ROW -->

		<div class="row">

			<!-- NEW COL START -->
			<article class="col-sm-12 col-md-12 col-lg-6">

				<!-- Widget ID (each widget will need unique ID)-->
				<div class="jarviswidget" data-widget-colorbutton="false" data-widget-editbutton="false" data-widget-custombutton="false">

					<header>
						<header style="line-height: 35px;height: 100%;font-size: 16px;text-indent: 12px;">征询信息</header>
					</header>

					<!-- widget div-->
					<div>

						<!-- widget edit box -->
						<div class="jarviswidget-editbox">
							<!-- This area used as dropdown edit box -->
							
						</div>
						<!-- end widget edit box -->

						<!-- widget content -->
						<div class="widget-body no-padding">

							<form class="smart-form" id="oinfos">
								<header>用户信息</header>
								<fieldset>
									<section>
										<label class="label">申请人</label>
										<label class="input">
											<input type="text"   :value="create.name" class="input-sm" disabled="disabled">
										</label>										
									</section>									
									<section>
										<label class="label">申请人职务</label>
										<label class="input">
											<input type="text" :value="create.duty" disabled="disabled">
										</label>
									</section>
									<section>
										<label class="label">负责人</label>
										<label class="input">
											<input type="text"   :value="charge.name" class="input-sm" disabled="disabled">
										</label>										
									</section>									
									<section>
										<label class="label">负责人职务</label>
										<label class="input">
											<input type="text" :value="charge.duty" disabled="disabled">
										</label>
									</section>
									<section>
										<label class="label">下单时间</label>
										<label class="input">
											<input type="text"  :value="order.time | timetrans(1)" disabled="disabled">
										</label>
									</section>
								</fieldset>
								<header>商品信息</header>
								<fieldset>
									<section>
										<label class="label">订单编号</label>
										<label class="input">
											<input type="text"  :value="order.order_no" disabled="disabled">
										</label>
									</section>
									<table id="dt_basic" class="table table-striped table-bordered table-hover dataTable" aria-describedby="dt_basic_info">
                                        <thead>
                                            <tr role="row">
                                                <th>产品名称</th>
                                                <th>产品规格</th>
                                                <th>产品类型</th>
                                                <th>产品单价</th>
                                                <th>数量</th>
                                            </tr>
                                        </thead>
                                        <tbody role="alert" aria-live="polite">											
												<tr class="odd"  v-for="list in goods">
													<td>{{list.name}}</td>
													<td>{{list.standard}}</td>
													<td>{{list.type}}</td>
													<td>{{list.price}}</td>
													<td>{{list.num}}</td>
												</tr>
                                        </tbody>
                                  </table>	
                                  <section>
										<label class="label">收货信息</label>
										<label class="input">
											<input type="text"  :value="order.addr" disabled="disabled">
										</label>
									</section>
									<section>
										<label class="label">备注</label>
										<label class="textarea">
											<textarea name="" rows="" cols="" disabled="disabled">{{order.note}}</textarea>
										</label>
									</section>
								<section class="float-right">
										<label style="padding-right: 50px;">
											<span>￥{{order.acamount}}</span>
										</label>
										<label class="label">总价:</label>
										
									</section>	
								</fieldset>	

								<header>征询信息</header>																
								<fieldset>																																	
									<section>
										<label class="label">征询人</label>
										<label class="input">
											<input type="text"  :value="juryMan.name" disabled="disabled">
										</label>
									</section>
									<section>
										<label class="label">征询人职务</label>
										<label class="input">
											<input type="text"  :value="juryMan.duty" disabled="disabled">
										</label>
									</section>
									<section>
										<label class="label">征询信息</label>
										<label class="textarea">
											<textarea name="" rows="" cols="" disabled="disabled">{{juryMan.note}}</textarea>
										</label>
									</section>
									<section>
										<label class="label">征询时间</label>
										<label class="input">
											<input type="text"  :value="juryMan.time | timetrans(3)" disabled="disabled">
										</label>
									</section>
								</fieldset>	
								<header>回复</header>																
								<fieldset>																																	
									<section>
										<label class="label">回复信息</label>
										<label class="input">
											<textarea name="" rows="" cols="" style="width: 90%;min-height: 100px;padding: 5px;" class="notesss"></textarea>
										</label>
									</section>									
								</fieldset>	
								<footer>
									<button type="button" class="btn btn-primary" @click="submit1">提交</button>																		
									<button type="button" class="btn btn-default" >
										忽视
									</button>
								</footer>
							</form>							
							</div>  
						</div>
						<!-- end widget content -->

					</div>
					<!-- end widget div -->

				</div>
				<!-- end widget -->
			</article>
		</div>

		<!-- END ROW -->

	</section>

</div>

<include file="layout/footer" />
<script src="__JS__/layer/layer.js"></script>
<script>
	Vue.filter("timetrans",function(date,type){
        var date = new Date(date*1000);//如果date为10位不需要乘1000
        var Y = date.getFullYear();
        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1);
        var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
        var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
        var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes());
        var s = (date.getSeconds() <10 ? '0' + date.getSeconds() : date.getSeconds());        
        if(type==1){
          return Y+"/"+M+"/"+D+" "+h+":"+m+":"+s;
        }else if(type==2){
          return Y+"/"+M+"/"+D;
        } else if(type==3){
          return M+"/"+D+" "+h+":"+m;
        }     
      });
 	var str=location.href;
	var str=str.split("id/")[1];
	var ids=str.split(".html")[0];
	var vm=new Vue({
		el:"#oinfos",
		data:{
        	show:false,
        	base:[],
        	charge:[],
        	create:[],
        	goods:[],
        	order:[],
        	jury:[],
        	result:"",
        	noteshow:true,
        	juryMan:[],
        	isOk:1,
        	lookedP:false,
        	lookedC:false,
        	span1:false,
        	span2:false,
        },
		methods:{
			submit1:function(){
				var notesss=$(".notesss").val();
				$.ajax({
					type:"post",
					url:"{{:url('manage/Affairorder/processAffair')}}",
					data:{
						id:ids,
						note:notesss,
						action:"inquiry"
					},
					success:function(data){
						var data=JSON.parse(data);
						if(data.status==1){
							layer.msg('回复成功！');
						}else{
							layer.msg(data.message)
						}
					}
				})
			},
			changeisOk:function(){
				if(this.isOk==1){
					this.isOk=0;
				}else{
					
					this.isOk=1;
				}
			},
			mouseOn:function(index){
				if(index==1){
					this.span1=true;
				}else if(index==2){
					this.span2=true;
				}
			},
			mouseLe:function(index){
				if(index==1){
					this.span1=false;
				}else if(index==2){
					this.span2=false;
				}
			}
		},
		created(){ 			
        	var _this=this;
        	$.ajax({
        		type:"post",
        		data:{
        			id:ids
        		},
        		url:"{{:url('manage/Affairorder/inquiry')}}",
        		success:function(data){
        			var data=JSON.parse(data);
        			var data=data.data;
        			_this.base=data.base;
        			_this.charge=_this.base.charge;
        			_this.create=_this.base.create;
        			_this.jury=data.jury;
        			_this.juryMan=_this.jury.juryMan;
        			//
        			var order=data.order;
        			_this.order=order;
        			_this.goods=order.goods;
        			if(_this.jury.type==-1){
        				_this.result="处理中";
        				_this.noteshow=false;
        			}else if(_this.jury.type==0){
        				_this.result="未通过";
        			}else if(_this.jury.type==1){
        				_this.result="通过";
        			}   			
        		}
        	})
      	},
	})
	
</script>





















